package com.cn.wanxi.servlet.pageDataFindAll;

import com.alibaba.fastjson.JSONObject;
import com.cn.wanxi.model.RecruitmentModel;
import com.cn.wanxi.service.IRecruitmentService;
import com.cn.wanxi.service.impl.RecruitmentServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/recruitment")
public class RecruitmentServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        IRecruitmentService iRecruitment=new RecruitmentServiceImpl();
        List<RecruitmentModel> recruitmentFind=iRecruitment.recruitmentFind();

        JSONObject jsonObject=new JSONObject();
        jsonObject.put("recruitmentFind",recruitmentFind);
        resp.getWriter().println(jsonObject);
    }
}
